//
//  MineViewController.m
//  O2O Product
//
//  Created by 特沃兹 on 2017/12/29.
//  Copyright © 2017年 Product Author. All rights reserved.
//

#import "MineViewController.h"

@interface MineViewController ()

@end

@implementation MineViewController

#pragma mark - ---------- Lazy Loading（懒加载） ----------
-(UIButton *)loginButton {
    if (_loginButton == nil) {
        _loginButton = [UIButton buttonWithType:UIButtonTypeCustom];
        _loginButton.backgroundColor = COLOR_RGB(0xffffff, 0.2);
        _loginButton.layer.cornerRadius = 19.5;
        _loginButton.layer.borderWidth = 0.5;
        _loginButton.layer.borderColor = COLOR_RGB(0xffffff, 0.2).CGColor;
        [_loginButton setTitle:@"登录/注册" forState:UIControlStateNormal];
        [_loginButton setTitleColor:COLOR_RGB(0xffffff, 1) forState:UIControlStateNormal];
        [_loginButton addTarget:self action:@selector(LoginAction) forControlEvents:UIControlEventTouchUpInside];
    }
    return _loginButton;
}
-(UIButton *)informationButton{
    if (_informationButton == nil) {
        _informationButton = [UIButton buttonWithType:UIButtonTypeCustom];
        [_informationButton setImage:[UIImage imageNamed:@"Login_Validation"] forState:UIControlStateNormal];
    }
    return _informationButton;
}
#pragma mark - ----------   Lifecycle（生命周期） ----------
-(void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    [self.navigationItem setTitle:@"个人中心"];
}
- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self InitSubView];
}
#pragma mark - ---------- Private Methods（私有方法） ----------

#pragma mark initliaze data(初始化数据)

#pragma mark config control（布局控件）
-(void)InitSubView{
    //个人背景图
    UIImageView *person_background = [[UIImageView alloc]init];
    person_background.image = [UIImage imageNamed:@"person_background"];
    [self.view addSubview:person_background];
    [person_background mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_offset(0);
        make.size.mas_offset(CGSizeMake(Main_Screen_Width, 170));
        make.top.mas_offset(0);
    }];
    [person_background addSubview:self.loginButton];
    [self.loginButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_offset(0);
        make.top.mas_offset(20);
        make.size.mas_offset(CGSizeMake(AdaptedWidth(123), AdaptedHeight(39)));
    }];
    [person_background addSubview:self.informationButton];
    [self.informationButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_offset(12);
        make.right.mas_offset(-12);
        make.size.mas_offset(CGSizeMake(24, 24));
    }];
}
#pragma mark networkRequest (网络请求)



#pragma mark IBActions （点击事件xib）

-(void)LoginAction{
    
    [self.navigationController pushViewController:[LoginViewController new] animated:YES];
    
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
